//
//  TemporaryDirectoryCategory.m
//  xsd2cocoa
//
//  Created by Stefan Winter on 18.06.11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "TemporaryDirectoryCategory.h"


@implementation NSFileManager (TemporaryDirectoryCategory)

-(NSString *) createTemporaryDirectory {
    // Create a unique directory in the system temporary directory
    NSString *guid = [[NSProcessInfo processInfo] globallyUniqueString];
    NSString *path = [NSTemporaryDirectory() stringByAppendingPathComponent:guid];
    if (![self createDirectoryAtPath:path withIntermediateDirectories:NO attributes:nil error:nil]) {
        return nil;
    }
    return path;
}

@end
